<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试分页</title>
</head>
<link rel="stylesheet" href="../css/bootstrap.css">
<script type="application/javascript" src="../js/jquery-3.5.1.js"></script>
<script>
    $.ready(function page(page) {
        $.ajax({
            type: "GET",
            url: "http://localhost:8080/user/getAll",
            dataType: "json",
            success: function (data) {
                for (let i = 0; i < data.length; i++) {
                    data.innerHTML += "<tr><td>" + data[i].name + "</td>" +
                        "<td>" + data[i].score + "</td></tr>";
                }
                let a = document.getElementById("tbody").getElementsByTagName("tr");
                let zz =new Array(a.length);
                for(let i=0;i<a.length;i++) {
                    zz[i]=a[i].innerHTML
                }
                //当前页
                let pageNum=1;
                //每页多少条信息
                let pageSize=5;
                //总页数
                if(zz.length % pageSize==0) {
                    let  pageAll = zz.length / pageSize
                } else {
                    let  pageAll = (zz.length / pageSize)+1
                }

            }
        })
    })
</script>
<body>
<div>
    <table>
        <tr>
            <td>
                姓名
            </td>
            <td>
                分数
            </td>
        </tr>
        <tbody id="tbody">
        </tbody>
    </table>
</div>

<div class="page">

</div>

</body>
</html>